isbg.learn_mail
- isbg.learn_mail(mail, learn_type)
Process a email and try to learn or unlearn it.
- Parameters:
mail (email.message.Message) – email to learn.
learn_type (str) –
`spam`to learn spam,`ham`to learn nonspam or`forget`.
- Returns:
It returns a pair of int
- The first integer:
A return code of
6means it was already learned or forgotten, a return code of5means it has been learned or forgotten, a-9999means an error communicating withspamc. Ifspamcreturns an exit code, it returns it.- The second integer:
It’s the original exit code from
spamc
- Return type:
int, int
Notes
See Exit Codes section of the man page of
spamcfor more information about other exit codes.